﻿layui.define(['form'], function (exports) {
    var form = layui.form();
    form.on('submit(create)', function (data) {
        if (!form.verify())
            return false;
        var name = data.field.Name;
        var check = app.syncPost('/articlecategories/exists', { newName: name }).responseJSON;
        if (check.code == 200) {
            return true;
        }
        else {
            layer.msg(check.msg);
            return false;
        }
    })
    exports('articlecategory/create', {});
});